#!/usr/bin/env python3
# _*_coding:utf-8_*_
# cockroach
# email:donnie.fan@foxmail.com

from code.core import file_processing
from code.conf import settings

path_db = settings.conf()
path_db = path_db.get("path_db")

def auth(user,passwd):
    '''
    认证系统，负责用户信息认证。
    :param user:
    :param passwd:
    :return:
    '''
    print("in the auth.py,auth user is %s passwd is %s" % (user,passwd))
    passport = False
    user_dict = file_processing.r_file(path_db)
    if user == user_dict['id'] and passwd == user_dict['password']:
        passport = True

    return passport
